from django.db import models


# Create your models here.
class Idc(models.Model):
    name = models.CharField(max_length=32, verbose_name='机房名称')
    address = models.CharField(max_length=128, verbose_name='机房地址')
    manage = models.CharField(max_length=32, verbose_name='联系人', help_text='机房联系人')
    phone = models.CharField(max_length=11, verbose_name='联系电话', help_text='机房联系电话')
    email = models.EmailField(verbose_name='邮箱', help_text='机房联系人邮箱')
    letter = models.CharField(max_length=12, verbose_name='IDC简称', help_text='机房简称')
    ctime = models.DateTimeField(auto_now_add=True, help_text='添加时间')

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = verbose_name_plural = '机房信息'
        db_table = 'idc'
        ordering = ['-ctime', 'name']
